package it.enea.xlab.tebes.users;

import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import it.enea.xlab.tebes.common.Profile;
import it.enea.xlab.tebes.entity.User;


@Stateless
@Interceptors({Profile.class})
public class UserManagerImpl implements UserManagerRemote {

	@PersistenceContext(unitName="TeBESPersistenceLayer")
	private EntityManager eM; 
	
	public Long createUser(User user) {

		eM.persist(user);		
		return user.getUserId();
	}

	public Long readUser(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	public Boolean updateUser(User user) {
		// TODO Auto-generated method stub
		return null;
	}

	public Boolean deleteUser(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

}
